<template>
    <div class="hello">
        <h1>我是Demo</h1>
        {{demoNum}}
        <button @click="addNumFn">一直点</button>
    </div>
</template>
<script>
import { mapGetters } from "vuex";

export default {
    name: "Demo",
    computed: {
        ...mapGetters({
            demoNum: "addNum"
        })
    },
    methods:{
        addNumFn(){
            this.$store.commit("addNumFn");
        }
    }
};
</script>
